const cartReducer = function(state, action) {//数据与action提交类型
    switch(action.type){
      case 'ADD_TO_CART':
        // return {
        //   cart:state.cart.pop()
        // }
        return{
          cart:state.cart.push(action.payload)
        };break;
      case 'on_open':
        return {
          count:state.count+action.payload
        }
    }
    return state;
}

export default {
    cartReducer
}